import IPairTxData from '~/models/IData'
import IPlugin from './IPlugin'

export default class AccountPlugin implements IPlugin {

    name = 'Account'

    async modData(data: IPairTxData) {
        const mints = data.mints
        const burns = data.burns
        const swaps = data.swaps

        for (let i = 0; i < mints.length; i++) {
            mints[i].account = mints[i].to
        }
        for (let i = 0; i < burns.length; i++) {
            burns[i].account = burns[i].sender
        }
        for (let i = 0; i < swaps.length; i++) {
            swaps[i].account = swaps[i].to
        }
        return data
    }
}